<template>
	<view class="customNavBar-container">
		<view class="nav-bar">
			<view class="status-bar" :style="{height:getStatusBarHeight()+'px'}"></view>
			<view class="title-bar" :style="{height:getTitleBarHeight()+'px'}">
				<view class="title" style="line-height: 1.3em;">{{title}}</view>
				<view class="search" :style="{height:getTitleBarHeight()*0.8+'px'}" >
					<navigator url="/pages/search/search">
						<uni-icons type="search" size="20"></uni-icons>
						<text class="text"  >搜索</text>
					</navigator>
					
				</view>
			</view>
		</view>
	<view class="fill" :style="{height:getNavBarHeight() + 'px'}">
		
	</view>
		</view>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { getSystemInfo,getTitleBarHeight ,getStatusBarHeight,getNavBarHeight} from '../../utils/system';
console.log(getTitleBarHeight());

console.log(getStatusBarHeight());
defineProps({
	title:{
		type:String,
		default:"壁纸"
	}
})

</script>

<style scoped lang="scss">
.customNavBar-container{
	.nav-bar{
		position: fixed;
		left: 0;
		top: 0;
		z-index: 99;
		width: 100%;
		background:
		linear-gradient(to bottom,rgba(0,0,0,0) ,#fff 400rpx),
		linear-gradient(to right,lightblue,lightcoral);
		.status-bar{}
		.title-bar{
			display: flex;
			padding: 0 30rpx;
			
			// border: 1px solid red;
			.title{
				font-size:26rpx ;
				color:$text-font-color-main;
				font-weight: 700;
				// border: 1px solid aqua;
			}
			.search{
				margin-left: 30rpx;
				display: flex;
				align-items: center;
				width: 220rpx;
				height: 50rpx;
				background-color: rgba(255, 255, 255,.4);
				border-radius: 15rpx;
				.text{
					padding-left: 10rpx;
				}
			}
		}
	}
}
</style>